#pragma once

#include "../Base/BaseData.hpp"

using namespace base;

template <typename TList, typename TElemType>
class MasterList {
public:
    virtual ~MasterList() = default;

    virtual Status initList(TList& l) = 0;
    virtual Status destoryList(TList& l) = 0;
    virtual Status clearList(TList& l) = 0;
    virtual bool listEmpty(const TList l) = 0;
    virtual int listLength(const TList l) = 0;
    virtual Status getElem(const TList l, int i, TElemType& e) = 0;
    virtual int locateElem(const TList l, const TElemType e) = 0;
    virtual Status priorElem(const TList l, const TElemType cur_e, TElemType& pre_e) = 0;
    virtual Status nextElem(const TList l, const TElemType cur_e, TElemType& next_e) = 0;
    virtual Status listInsert(TList& l, int i, TElemType e) = 0;
    virtual Status listDelete(TList& l, int i) = 0;
    virtual Status traverseList(const TList l) = 0;
};
